<html>
    <head>
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    </head>
    <body>
        <div id="example-1">
            <button v-on:click="add">Add 1</button>
            <p>The button above has been clicked {{ counter }} times.</p>
            <button v-on:click="greet">greet</button>
            <button v-on:click="say('hi')">Say hi</button>
            <button v-on:click="say('yes')">Say yes</button>
        </div>
    </body>
    <script>
        var example = new Vue({
            el:"#example-1",
            data:{
                counter:0
            },
            methods:{
                add:function(){
                    this.counter += 1;
                },
                greet:function(event){
                    console.log("counter is:" + this.counter);
                    if(event){
                        console.log(event.target.tagName);
                    }
                },
                say:function(mess){
                    alert(mess);
                }
            }
        });
    </script>
</html>
